package com.guigu.basedservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.basedservice.dto.MaintenanceTypeDto;
import com.guigu.basedservice.entity.BaseCarFactory;
import com.guigu.basedservice.mapper.BaseMaintainTypeServMapper;
import com.guigu.basedservice.mapper.MaintenanceTypeDtoMapper;
import com.guigu.basedservice.service.MaintenanceTypeService;
import com.guigu.basedservice.vo.MaintenanceTypeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author heyuhang
 * @create 2024/9/25
 */
@Service
public class MaintenanceTypeServiceImpl implements MaintenanceTypeService {

    @Autowired(required = false)
    private MaintenanceTypeDtoMapper maintenanceTypeDtoMapperMapper;

    @Autowired(required = false)
    private BaseMaintainTypeServMapper baseMaintainTypeServMapper;

    @Override
    public PageInfo<MaintenanceTypeDto> getMaintenanceType(Integer currentPage, Integer pageSize, MaintenanceTypeVo vo) {
        PageHelper.startPage(currentPage,pageSize);
        List<MaintenanceTypeDto> maintenanceTypeDto = maintenanceTypeDtoMapperMapper.getMaintenanceTypeDto(vo);
        PageInfo<MaintenanceTypeDto> pageInfo=new PageInfo<>(maintenanceTypeDto);
        return pageInfo;
    }

    @Override
    public MaintenanceTypeDto getOne2(String id) {
        return maintenanceTypeDtoMapperMapper.getOne2(id);
    }


}
